﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Max.PH5_2010A.Shopping.IService
{
    public interface IBaseService<T>
    {
        int Insert(T model);
        int Insert(List<T> model);
        int Update(T model);
        int Delete(List<T> ts);
        IQueryable<T> Select();

        //IQueryable<T> Select(int pageIndex,int pageSize);
        //dynamic Select(int pageIndex, int pageSize);  //dynamic用dto去替代    什么是DTO？
        //PagesCount<T> Select(int pageIndex, int pageSize);
        //(IQueryable<T>,int) Select(int pageIndex, int pageSize);
        //Tuple<IQueryable<T>,int> Select(int pageIndex, int pageSize); //元祖
        IQueryable<T> Select(int pageIndex, int pageSize,out int total);


        IQueryable<T> Select<TKey>(Func<T,TKey> sort,bool isAsc);

    }

    //public class PagesCount<T>
    //{
    //    public IQueryable<T> list { get; set; }
    //    public int Total { get; set; }
    //}
}
